<template>
  <div>
    <a-card :bordered="false" class="card" title="项目进场-申请">
      <gc-project-entry-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" />
    </a-card>
    <footer-tool-bar>
      <a-button type="primary" @click="handleOk" :loading="loading">提交</a-button>
      <a-button style="margin-left: 8px">保存</a-button>
    </footer-tool-bar>
  </div>
</template>

<script>
import GcProjectEntryForm from './modules/GcProjectEntryForm'
import FooterToolBar from '@/components/tools/FooterToolBar'

export default {
  name: 'GcProjectEntryAdd',
  components: {
    GcProjectEntryForm,
    FooterToolBar,
  },
  data() {
    return {
      disableSubmit: false,
    }
  },
  created() { 
  },
  mounted(){
    this.$refs.realForm.addBefore();
  },
  methods: {
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add()
      })
    },
    edit(record) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record)
      })
    },
    close() {
      this.$emit('close')
      this.visible = false
    },
    handleOk() {
      this.$refs.realForm.handleOk()
    },
    submitCallback() {
      this.$emit('ok')
      this.visible = false
    },
    handleCancel() {
      this.close()
    },
  },
}
</script>

<style scoped>
</style>